//准备好前
Win10_child.onPreInit(function () {
    //加载桌面图标
    loadDeskIcon();
});

//准备好后
Win10_child.onReady(function () {
    //设置壁纸
    Win10_child.setBgUrl({
        main: '/assets/plugins/win10/img/wallpapers/main.jpg',
    });

    Win10_child.setAnimated([
        'animated flip',
        'animated bounceIn',
    ], 0.01);
});

//加载桌面图标
function loadDeskIcon() {
    $.ajax({
        url: config.base_server() + 'menus/list?parentId=101&access_token=' + config.getToken().access_token,
        type: 'GET',
        async: false,
        success: function (data) {
            if (!!data) {
                var $html = "";
                for (var i = 0; i < data.length; i++) {
                    $html += '<div class="shortcut win10-open-window" data-url="' + data[i].path +'">';
                    $html += '      <i class="icon ' + data[i].css + ' red"></i>';
                    $html += '    <div class="title">' + data[i].name + '</div>';
                    $html += ' </div>';
                }
                $("#win10-shortcuts").append($html);
            }
        }
    });
}
